package mutsumimod.cards.custom;

import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import mutsumimod.cards.BaseCard;
import mutsumimod.cards.copy.UnhealthyUika;
import mutsumimod.character.Mutsumi;
import mutsumimod.monitors.SuperMetalMonitor;
import mutsumimod.util.CardStats;
import mutsumimod.util.GeneralUtils;

public class SuperMetal extends BaseCard  {
    public static final String ID = makeID(SuperMetal.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.ATTACK,
            CardRarity.RARE,
            CardTarget.ENEMY,
            1
    );

    public SuperMetal() {
        super(ID, info);
        setAttr(0,0,0);
        setAttrUpg(0,0,0);
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        damageMonster(m);
    }

    public void calculateCardDamage(AbstractMonster mo) {
        int realBaseDamage = this.baseDamage;
        if(!upgraded){
            this.baseDamage += SuperMetalMonitor.maxDamage/2;
        }else{
            this.baseDamage += SuperMetalMonitor.maxDamage;
        }
        super.calculateCardDamage(mo);
        this.baseDamage = realBaseDamage;
        this.isDamageModified = this.damage != this.baseDamage;
    }

    public void applyPowers() {
        int realBaseDamage = this.baseDamage;
        if(!upgraded){
            this.baseDamage += SuperMetalMonitor.maxDamage/2;
        }else{
            this.baseDamage += SuperMetalMonitor.maxDamage;
        }
        super.applyPowers();
        this.baseDamage = realBaseDamage;
        this.isDamageModified = this.damage != this.baseDamage;
    }

    @Override
    public AbstractCard makeCopy() {
        return new SuperMetal();
    }

    @Override
    public void updateDescription() {
        if(upgraded){
            this.rawDescription=cardStrings.UPGRADE_DESCRIPTION;
        }else{
            this.rawDescription=cardStrings.DESCRIPTION;
        }
        initializeDescription();
    }

    @Override
    public void upgrade() {
        if(!this.upgraded) {
            this.upgradeName();
            updateDescription();
        }
    }
}